<script setup>
import {computed, ref} from "vue";
const firstName = ref("范");
const lastName = ref("冰冰");

const fullName = computed({
  // getter
  get() {
    return firstName.value + "@" + lastName.value;
  },
  // setter
  set(newValue) {
    // 注意：我们这里使用的是解构赋值语法
    [firstName.value, lastName.value] = newValue.split("@");
  },
});// fullName.value = "范 冰冰";
</script>

<template>

  <span>{{ fullName }}</span>
</template>

<style scoped>

</style>